package org.ccay.core.ioc;

import java.util.Map;

import org.springframework.core.type.MethodMetadata;

/**
 * 代理类
 */
public class MethodMetadataDelegate {

	public static final String CONTAIN_ANNOTATION_METHOD_NAME = "containerAnnotationMethodName";
	
	/** 所代理的方法元数据 **/
	private MethodMetadata methodMetadata;

	public MethodMetadataDelegate(MethodMetadata methodMetadata) {
		this.methodMetadata = methodMetadata;
	}

	/**
	 * 提供接口增加方法名获取
	 * @param annotationType
	 * @return
	 */
	public Map<String, Object> getAnnotationAttributes(String annotationType) {
		Map<String, Object> attributesMap = methodMetadata.getAnnotationAttributes(annotationType);
		if(attributesMap != null){
			attributesMap.put(CONTAIN_ANNOTATION_METHOD_NAME, methodMetadata.getMethodName());
		}
		
		return attributesMap;
	}

}
